import React, { Component } from 'react'
import { connect } from 'react-redux'
class List1 extends Component {
  render() {
    return (
      <div>
        list1
        <button onClick = { () => {
          this.props.changeList([4, 5, 6])
        }}>改变</button>
        {
          this.props.list.map((item, index) => (<div key={index}>{ item }</div>))
        }
      </div>
    )
  }
}

export default connect(
  ({list}) => ({list}),
  (dispatch) => ({
    changeList (payload) {
      dispatch({ type: 'CHANGE_LIST', payload })
    }
}))(List1)